package xyz.lwm.lazycat.aop;

import xyz.lwm.lazycat.aop.info.MethodInfo;
import xyz.lwm.lazycat.utility.matcher.Matcher;

/**
 * <h2>切面接口</h2>
 * 实现切面, 使相关类可以创建代理对象
 *
 * @author lwm
 */
public interface Aspect {

    /**
     * match aspect
     *
     * @return matcher for aspect
     * @see xyz.lwm.lazycat.aop.matcher.Matchers
     */
    default Matcher<MethodInfo> matcher() {
        return m -> false;
    }

    /**
     * intercept method
     */
    default InvocationHandler interceptor() {
        return invocation -> {};
    }

}
